#pragma once
#include "atlwince.h"

class CNewNameDlg :
    public CStdDialogResizeImplCancel<CNewNameDlg>
{
public:
    enum { IDD = IDD_NEW_NAME };

    BEGIN_DLGRESIZE_MAP(CNewNameDlg)
        DLGRESIZE_CONTROL(IDC_EDT_NAME, DLSZ_SIZE_X)
    END_DLGRESIZE_MAP()

    BEGIN_MSG_MAP(CNewNameDlg)
        MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
        MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
        MESSAGE_HANDLER(WM_SIZE, OnSize)
        COMMAND_ID_HANDLER(ID_MENU_NEXT, OnMenuNext)
        COMMAND_ID_HANDLER(ID_MENU_CANCEL, OnMenuCancel)
        COMMAND_HANDLER(IDC_EDT_NAME, EN_CHANGE, OnEdtNameChange)
        CHAIN_MSG_MAP(CStdDialogResizeImplCancel<CNewNameDlg>)
    END_MSG_MAP()

    inline CString GetName(void)
    { return m_Name; }

private:

    // Handler prototypes (uncomment arguments if needed):
    // LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
    // LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
    // LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)

    LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled);
    LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled);

    LRESULT OnMenuNext(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
    LRESULT OnMenuCancel(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
    LRESULT OnEdtNameChange(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);

    void UpdateUI(void);

    CEdit m_NameEdit;
    CString m_Name;
    int m_SelectedListItem;
};
